import request from '@/utils/request'

// 科目下拉
export function listType(query) {
    return request({
        url: '/system/subject/availableList',
        method: 'get',
        params: query
    })
}

// 查询科目信息列表
export function listInfo(query) {
    return request({
        url: '/system/paper/list',
        method: 'get',
        params: query
    })
}
// 考试名称
export function shiList(query) {
    return request({
        url: '/system/examtype/availableList',
        method: 'get',
        params: query
    })
}
// 查询科目信息详细
export function getInfo(id) {
    return request({
        url: '/system/paper/' + id,
        method: 'get'
    })
}
// 策略
export function infoList(query) {
    return request({
        url: '/system/assembly/list',
        method: 'get',
        params: query
    })
}
// 地市下拉   
export function areainfo(data = {}, query) {
    return request({
        url: `/system/area/list?pid=${query}`,
        method: 'get',
        params: query,
        data: JSON.stringify(data)
    })
}
// 地市下拉 全部查询
export function areasinfo(data = {}, query) {
    return request({
        url: `/system/area/list?`,
        method: 'get',
        params: query,
        data: JSON.stringify(data)
    })
}
// 修改科目信息
export function updateInfo(data) {
    return request({
        url: '/system/paper/',
        method: 'put',
        data: data
    })
}

// 删除科目信息
export function delInfo(id) {
    return request({
        url: '/system/paper/' + id,
        method: 'delete'
    })
}
// 修改里查看试题信息
export function shitigetInfo(id) {
    return request({
        url: '/system/questions/' + id,
        method: 'get'
    })
}
// 新增科目信息
export function addInfo(data) {
    return request({
        url: '/system/paper/',
        method: 'post',
        data: data
    })
}

// 知识点下拉  
export function outlineinfo(query) {
    return request({
        url: '/system/info/availableList',
        method: 'get',
        params: query
    })
}
// 错误率
export function difficultyinfo(query) {
    return request({
        url: '/system/difficulty/list',
        method: 'get',
        params: query
    })
}
// 命题人
export function personinfo(query) {
    return request({
        url: '/system/user/proposition',
        method: 'get',
        params: query
    })
}
// 题型下拉
export function typeinfo(query) {
    return request({
        url: '/system/type/availableList',
        method: 'get',
        params: query
    })
}
export function importTemplate(query) {
    return request({
        url: '/system/paper/export',
        method: 'get',
        params: query,
        responseType: 'blob' //必须要加上，转为blob类型
    })
}
// 批量导出word
export function importTemplates(ids) {
    return request({
        url: '/system/paper/export/' + ids,
        method: 'get',
        responseType: 'blob' //必须要加上，转为blob类型
    })
}
// 批量导出excel
export function excelimportTemplates(ids) {
    return request({
        url: '/system/paper/exportExcle/' + ids,
        method: 'get',
        // responseType: 'blob' //必须要加上，转为blob类型
    })
}
// export function excelimportTemplate(query) {
//     return request({
//         url: '/system/paper/exportExcle',
//         method: 'get',
//         params: query,
//         // responseType: 'blob' //必须要加上，转为blob类型
//     })
// }
export function daanlate(query) {
    return request({
        url: '/system/paper/exportAnswer',
        method: 'get',
        params: query,
        responseType: 'blob' //必须要加上，转为blob类型
    })
}
// 查询科目信息详细
export function duplicategetInfo(id) {
    return request({
        url: '/system/paper/duplicateList/' + id,
        method: 'get'
    })
}